<template>
	<view class="content">
		<u-navbar bgColor="transparent" titleStyle="color:#fff" title="累计收益" leftIconColor="#fff" :autoBack="true"
			:placeholder="true">
		</u-navbar>
		<view class="content-box">
			<view class="income-cont" v-for="(item,index) in list" :key="index">
				<view class="income-left">
					<view class="income-text">
						{{item.message}}
					</view>
					<view class="time">
						{{item.time}}
					</view>
				</view>
				<view class="income-num">
					{{item.sign == 1 ? '+' : ''}}{{item.num}}
				</view>
			</view>
			<u-loadmore :status="status" />
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				list: [],
				status: 'loadmore',
			}
		},
		onLoad() {
			this.getRecord()
		},
		onReachBottom() {
			this.page++
			this.status = 'loading'
			this.getRecord()
		},
		methods: {
			getRecord() {
				let params = {
					page: this.page,
					type: 9,
				}
				this.$Request({
					method: 'POST',
					url: '/api/Mutualaidorder/accountLog',
					data: params
				}).then(res => {
					if (res.code == 1) {
						if (res.data.list.length < 10) {
							this.status = 'nomore'
						}
						if (this.page == 1) {
							this.list = res.data.list
						} else {
							this.list = [...this.list, ...res.data.list]
						}
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #17191A;
	}
</style>
<style lang="scss" scoped>
	.content {
		background-image: url('../../../static/my/my-bg.png');
		background-repeat: no-repeat;
		background-size: 100% 558rpx;

		.content-box {
			padding: 30rpx;

			.income-cont {
				display: flex;
				justify-content: space-between;
				align-items: center;
				color: #fff;
				margin-bottom: 30rpx;
				background: linear-gradient(134deg, rgba(255, 227, 211, 0.06) 0%, rgba(67, 130, 84, 0.26) 100%);
				padding: 30rpx;
				border: 4rpx solid rgba(108, 233, 137, 0.12);
				border-radius: 30rpx;

				.income-left {
					.income-text {
						font-size: 29rpx;
						font-weight: 600;
					}

					.time {
						font-size: 24rpx;
						margin-top: 15rpx;
						color: #999;
					}
				}

				.income-num {
					font-size: 32rpx;
					font-weight: 600;
				}
			}
		}
	}
</style>